home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / flight-of-the-museum.swf / scripts / com / google / analytics / debug / Background.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.9 KB  |  68 lines

  1. package com.google.analytics.debug
  2. {
  3.    import flash.display.Graphics;
  4.    
  5.    public class Background
  6.    {
  7.        
  8.       
  9.       public function Background()
  10.       {
  11.          super();
  12.       }
  13.       
  14.       public static function drawRounded(target:*, g:Graphics, width:uint = 0, height:uint = 0) : void
  15.       {
  16.          var W:uint = 0;
  17.          var H:uint = 0;
  18.          var R:uint = uint(Style.roundedCorner);
  19.          if(width > 0 && height > 0)
  20.          {
  21.             W = width;
  22.             H = height;
  23.          }
  24.          else
  25.          {
  26.             W = uint(target.width);
  27.             H = uint(target.height);
  28.          }
  29.          if(Boolean(target.stickToEdge) && target.alignement != Align.none)
  30.          {
  31.             switch(target.alignement)
  32.             {
  33.                case Align.top:
  34.                   g.drawRoundRectComplex(0,0,W,H,0,0,R,R);
  35.                   break;
  36.                case Align.topLeft:
  37.                   g.drawRoundRectComplex(0,0,W,H,0,0,0,R);
  38.                   break;
  39.                case Align.topRight:
  40.                   g.drawRoundRectComplex(0,0,W,H,0,0,R,0);
  41.                   break;
  42.                case Align.bottom:
  43.                   g.drawRoundRectComplex(0,0,W,H,R,R,0,0);
  44.                   break;
  45.                case Align.bottomLeft:
  46.                   g.drawRoundRectComplex(0,0,W,H,0,R,0,0);
  47.                   break;
  48.                case Align.bottomRight:
  49.                   g.drawRoundRectComplex(0,0,W,H,R,0,0,0);
  50.                   break;
  51.                case Align.left:
  52.                   g.drawRoundRectComplex(0,0,W,H,0,R,0,R);
  53.                   break;
  54.                case Align.right:
  55.                   g.drawRoundRectComplex(0,0,W,H,R,0,R,0);
  56.                   break;
  57.                case Align.center:
  58.                   g.drawRoundRect(0,0,W,H,R,R);
  59.             }
  60.          }
  61.          else
  62.          {
  63.             g.drawRoundRect(0,0,W,H,R,R);
  64.          }
  65.       }
  66.    }
  67. }
  68.